import VueRouter from 'vue-router'

//导入底部的路由组件
import HomeContainer from './components/tabbar/HomeContainer.vue'
import MemberContainer from './components/tabbar/MemberContainer.vue'
import SearchContainer from './components/tabbar/SearchContainer.vue'
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue'
//第二层组件
import NewsList from './components/news/NewsList.vue'
//新闻详情
import NewsInfo from './components/news/Newslnfo.vue'
//图片分享
import PhotoList from './components/photos/photoList.vue'
//图片分享详情
import PhotoInfo from './components/photos/photolnfo.vue'
//商品购买
import GoodesList from './components/goods/GoodsList.vue'
//商品详情
import GodesInfo from './components/goods/Goodslnfo.vue'

import GoodsDesc from './components/goods/GoodsDesc.vue'
import GoodsComment from './components/goods/GoodsComment.vue'

// 3. 创建路由对象
var router = new VueRouter({
  routes: [ //底部的路由组件
    {
      path: './',
      redirect: '/homr'
    }, //重定向默认在首页
    {
      path: '/home',
      component: HomeContainer
    },
    {
      path: '/member',
      component: MemberContainer
    },
    {
      path: '/shopcar',
      component: SearchContainer
    },
    {
      path: '/search',
      component: ShopcarContainer
    },
    //第二层路由对象
    {
      path: '/home/newslist',
      component: NewsList
    },
    {
      path: '/home/newsinfo/:id',
      component: NewsInfo
    },
    //图片分享
    {
      path: '/home/photolist',
      component: PhotoList
    },
    //图片分享详情
    {
      path: '/home/photoinfo/:id',
      component: PhotoInfo
    },
    //商品购买
    {
      path: '/home/goodslist',
      component: GoodesList
    },
    //商品详情
    {
      path: '/home/goodsinfo/:id',
      component: GodesInfo, name: 'goodsinfo'
    },

    { path: '/home/goodsdesc/:id', component:GoodsDesc, name: 'goodsdesc'  },
    { path: '/home/goodscomment/:id', component: GoodsComment, name: 'goodscomment' }

  ],
  linkActiveClass: 'mui-active' //覆盖默认 mui-tab-item router-link-exact-active mui-active
})

// 把路由对象暴露出去
export default router